using System;
using System.Data.SqlClient;
using DataAccess;

namespace Business
{
    public class CountryBusiness
    {
        /// <summary>
        /// Gets the instance.
        /// </summary>
        /// <value>
        /// The instance.
        /// </value>
        public static CountryBusiness Instance { get; private set; }

        /// <summary>
        /// Initializes the <see cref="CountryBusiness" /> class.
        /// </summary>
        static CountryBusiness() { Instance = new CountryBusiness(); }


        /// <summary>
        /// Gets the country.
        /// </summary>
        /// <param name="countryId">The country id.</param>
        /// <returns></returns>
        public Entities.Country GetCountry(string countryId)
        {
            try
            {
                if (!string.IsNullOrEmpty(countryId) && countryId != Guid.Empty.ToString())
                    return CountryDataAccess.Instance.GetCountry(countryId);
                return null;
            }
            catch (SqlException)
            {
                return null;
            }

        }

    }
}